package uk.ac.ebi.dod.beans;

import javax.faces.event.ActionEvent;
import java.util.Map;
import java.util.HashMap;

/**
 * @author Florian Reisinger
 * @version $Id$
 * @since x.y
 */
public class TestBean {
    String key;
    String value;

    Map<String, String> items = new HashMap<String, String>();

    public TestBean() {
        System.out.println("creating new test bean");
        items.put("key0", "value0");
    }

    ///// ///// ///// ///// /////
    // GETTER & SETTER

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public Map<String, String> getItems() {
        return items;
    }


    ///// ///// ///// ///// /////
    // METHODS

    public void add(ActionEvent e) {
        System.out.println("adding values to bean " + this);
        if (key != null) {
            items.put(key, value);
        }
    }


}
